package com.lottery.ruok.lottrey.adapter;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.lottery.ruok.lottrey.fragment.ChildOrderFragment;

/**
 * Created by ASUS on 2017/11/13.
 */

public class OrderPagerAdapter extends FragmentStatePagerAdapter {

    public OrderPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int i) {
        ChildOrderFragment childOrderFragment = new ChildOrderFragment();
        Bundle bundle = new Bundle();
        bundle.putInt("index", i);
        childOrderFragment.setArguments(bundle);
        return childOrderFragment;
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0:
                return "全部订单";
            case 1:
                return "已中奖";
            case 2:
                return "待开奖";
            default:
                return "已撤单";
        }
    }
}
